﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UserNotification.cs" company="YellowFish">
//   Copyright © YellowFish 2009
// </copyright>
// <summary>
//   Contains information used for a user notification.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace MobilePal.WindowsNative.Notification
{
  #region Imported Namespaces


  using System.Runtime.InteropServices;


  #endregion


  /// <summary>
  /// Contains information used for a user notification.
  /// </summary>
  [StructLayout(LayoutKind.Sequential)]
  public class UserNotification
  {
    private int ActionFlags;

    [MarshalAs(UnmanagedType.LPWStr)]
    private string pwszDialogTitle;

    [MarshalAs(UnmanagedType.LPWStr)]
    private string pwszDialogText;

    [MarshalAs(UnmanagedType.LPWStr)]
    private string pwszSound;

    private int dwReserved;

    /// <summary>
    /// Any combination of the <see cref="T:MobilePal.WindowsNative.Notification.NotificationAction"/> members.  
    /// </summary>
    /// <value>
    /// Flags which specifies the action(s) to be taken when the notification is triggered.
    /// </value>
    /// <remarks>
    /// Flags not valid on a given hardware platform will be ignored.
    /// </remarks>
    public NotificationAction Action
    {
      get
      {
        return (NotificationAction)ActionFlags;
      }

      set
      {
        ActionFlags = (int)value;
      }
    }

    /// <summary>
    /// Required if NotificationAction.Dialog is set, ignored otherwise.
    /// </summary>
    public string Title
    {
      get
      {
        return pwszDialogTitle;
      }

      set
      {
        pwszDialogTitle = value;
      }
    }

    /// <summary>
    /// Required if NotificationAction.Dialog is set, ignored otherwise.
    /// </summary>
    public string Text
    {
      get
      {
        return pwszDialogText;
      }

      set
      {
        pwszDialogText = value;
      }
    }

    /// <summary>
    /// Sound string as supplied to PlaySound.
    /// </summary>
    public string Sound
    {
      get
      {
        return pwszSound;
      }

      set
      {
        pwszSound = value;
      }
    }

    internal int MaxSound
    {
      get;

      set;
    }
  }
}